// 统一管理项目接口地址
import axios from "@/request/request";
// 引入序列化
import qs from "qs"

// 获取精品推荐的数据(不使用函数 会自动发送请求)
export const JingpinAPI = () => axios.get("/products/recommend")

// 获取热门数据
export const RemenAPI = () => axios.get("/products/hot")

// 发送手机验证码/sendSMS
export const sendSMSAPI = (params) => axios.post("/sendSMS", qs.stringify(params))

// 发送短信号码登录请求
export const phoneReginAPI = (params) => axios.post("/phoneRegin", qs.stringify(params))

// 发送微信登录请求
export const WeiXinLoginAPI = (params) => axios.post("/wechatUsers/PCLogin", qs.stringify(params))

// 微信绑定手机号
export const bindingAPI = (params) => axios.post("/wechatUsers/binding", qs.stringify(params))

// 获取用户信息
export const UserProfilesAPI = () => axios.get("/shop/userProfiles")

// 获取详情信息
export const goodsDetailAPI = (params) => axios.get(`/products/${params}`)

// 加入到购物车
export const addToCartAPI = (params) => axios.post("/shop/carts/add", qs.stringify(params))

// 获取所有产品
export const GoodsSearchAPI = (params) => axios.get("/products", { params })   //params:params

// 查看购物车
export const checkCartAPI = () => axios.get('/shop/carts')
